package com.ruoyi.deeplearn.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.deeplearn.mapper.DeepForecastResultItemMapper;
import com.ruoyi.deeplearn.domain.DeepForecastResultItem;
import com.ruoyi.deeplearn.service.IDeepForecastResultItemService;

/**
 * 预测结果Service业务层处理
 * 
 * @author rww
 * @date 2023-01-09
 */
@Service
public class DeepForecastResultItemServiceImpl implements IDeepForecastResultItemService 
{
    @Autowired
    private DeepForecastResultItemMapper deepForecastResultItemMapper;

    /**
     * 查询预测结果
     * 
     * @param id 预测结果主键
     * @return 预测结果
     */
    @Override
    public DeepForecastResultItem selectDeepForecastResultItemById(Long id)
    {
        return deepForecastResultItemMapper.selectDeepForecastResultItemById(id);
    }

    /**
     * 查询预测结果列表
     * 
     * @param deepForecastResultItem 预测结果
     * @return 预测结果
     */
    @Override
    public List<DeepForecastResultItem> selectDeepForecastResultItemList(DeepForecastResultItem deepForecastResultItem)
    {
        return deepForecastResultItemMapper.selectDeepForecastResultItemList(deepForecastResultItem);
    }

    /**
     * 新增预测结果
     * 
     * @param deepForecastResultItem 预测结果
     * @return 结果
     */
    @Override
    public int insertDeepForecastResultItem(DeepForecastResultItem deepForecastResultItem)
    {
        deepForecastResultItem.setId(IdUtil.getSnowflakeNextId());
        return deepForecastResultItemMapper.insertDeepForecastResultItem(deepForecastResultItem);
    }

    /**
     * 修改预测结果
     * 
     * @param deepForecastResultItem 预测结果
     * @return 结果
     */
    @Override
    public int updateDeepForecastResultItem(DeepForecastResultItem deepForecastResultItem)
    {
        return deepForecastResultItemMapper.updateDeepForecastResultItem(deepForecastResultItem);
    }

    /**
     * 批量删除预测结果
     * 
     * @param ids 需要删除的预测结果主键
     * @return 结果
     */
    @Override
    public int deleteDeepForecastResultItemByIds(Long[] ids)
    {
        return deepForecastResultItemMapper.deleteDeepForecastResultItemByIds(ids);
    }

    /**
     * 删除预测结果信息
     * 
     * @param id 预测结果主键
     * @return 结果
     */
    @Override
    public int deleteDeepForecastResultItemById(Long id)
    {
        return deepForecastResultItemMapper.deleteDeepForecastResultItemById(id);
    }
}
